import Vue from 'vue'
import VueRouter from 'vue-router'

import Home from '../views/Home/home.vue'
import Friends from '../views/Friends/friend.vue'
import Search from '../views/Search/search.vue'
import Carts from '../views/Carts/cart.vue'
import NewList from '../views/Home/newList'
import Newinfo from '../views/Home/newInfo'
import Photos from '../views/photos'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    component: Home,
    meta: {
      title: '首页',
      isShow: true
    }
  },
  {
    path: '/home/newslist',
    name: 'newslist',
    component: NewList,
    meta: {
      title: '新闻列表',
      isShow: true
    }
  },
  {
    path: '/home/newsinfo/:id',
    name: 'newsinfo',
    component: Newinfo,
    meta: {
      title: '新闻详情',
      isShow: true
    },
    props: true
  },
  {
    path: '/home/photolist',
    name: 'photolist',
    component: Photos,
    meta: {
      title: '图片列表',
      isShow: true
    }
  },
  {
    path: '/friend',
    name: 'friend',
    component: Friends,
    meta: {
      title: '会员',
      isShow: true
    }
  },
  {
    path: '/search',
    name: 'search',
    component: Search,
    meta: {
      title: '搜索',
      isShow: true
    }
  },
  {
    path: '/carts',
    name: 'carts',
    component: Carts,
    meta: {
      title: '购物车',
      isShow: true
    }
  }
]

const router = new VueRouter({
  routes
})

export default router
